﻿<%@ Page Title="Post Company Products / Projects - Savory Housing" Language="C#"
    MasterPageFile="~/RealState.Master" AutoEventWireup="true" CodeBehind="Post_Product_Projects.aspx.cs"
    Inherits="WebApplication.Post_Product_Projects" EnableEventValidation="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
  <script src="Scripts/Registration.js" type="text/javascript"></script>
    <script src="Scripts/Common.js" type="text/javascript"></script>
 <script type="text/javascript">
     $(document).ready(function () {
         $('#<%=ddlCity.ClientID%>').attr("disabled", true);
         $('#<%=ddlCountry.ClientID%>').change(getCity);
         $('#<%=ddlCountry.ClientID%>').change(getCurrency);
         $('#<%=ddlCity.ClientID%>').append(new Option('City', 'City', false));
         $(":input[title]").each(function () {
             $(this).val($(this).attr("title"));
             $(this).bind('focus', function () {
                 if ($(this).val() == $(this).attr("title")) $(this).val('');
             });
             $(this).bind('blur', function () {
                 if ($(this).val() == '') $(this).val($(this).attr("title"));

             });
         });

       
     });

     function getCity() {
         $('#<%=ddlCity.ClientID%>').attr("disabled", true);
         $("select[id$=ddlCity] > option").remove();
         $('#<%=ddlCity.ClientID%>').append(new Option('City', 'City', false));
         $.ajax({
             type: "POST",
             url: "/CountryService.asmx/GetCity",
             data: "{Country: '" + $('#MainContent_ddlCountry').val() + "'}",
             contentType: "application/json; charset=utf-8",
             dataType: "json",
             success: function (response) {
                 var models = (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d;
                 for (var i = 0; i < models.length; i++) {
                     var val = models[i];
                     var text = models[i];
                     $('#MainContent_ddlCity').append(new Option(text, val, false));
                 }
                 $('#<%=ddlCity.ClientID%>').attr("disabled", false);
             },
             error: function (XMLHttpRequest, textStatus, errorThrown) {
             }

         });
     }     
     function getCurrency() {
         $.ajax({
             type: "POST",
             url: "/CountryService.asmx/GetCurrency",
             data: "{Country: '" + $('#MainContent_ddlCountry').val() + "'}",
             contentType: "application/json; charset=utf-8",
             dataType: "json",
             success: function (response) {
                 //var objectvalue = jQuery.parseJSON(response.d);
                 $('#MainContent_txtPriceM2').val(response.d);

             },
             error: function (XMLHttpRequest, textStatus, errorThrown) {
             }

         });
     }
        
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
 <asp:HiddenField ID="hdnAlertCounter" runat="server" />
    <div class="left">
        <dl class="form clearfix" style="margin-left: 15px;">
            <br />
            <dt>
                <p class="purple" style="padding: 10px 0px 0px 0px;">
                    <strong>Details</strong></p>
                <div style="height: 5px;">
                </div>
                <div class="res_ad">
                    <asp:TextBox ID="txtlotarea" runat="server" MaxLength="10" CssClass="form-text wdth150_inp"
                        title="Product/Project Name"></asp:TextBox>
                        <span class="red">*</span> 
                </div>
                <div class="res_ad">
                    <asp:TextBox ID="txtYear" MaxLength="10" CssClass="form-text wdth150_inp" title="Year"
                        runat="server"></asp:TextBox>
                        <span class="red">*</span> 
                </div>
                <div class="res_ad">
                   
                     <asp:DropDownList ID="ddlCountry"  runat="server" CssClass="form-text wdth150">
                        </asp:DropDownList>
                        <span class="red">*</span> 
                </div>
                <div class="res_ad">
                   <asp:DropDownList ID="ddlCity" CssClass="form-text wdth150" runat="server" >
                        </asp:DropDownList>
                        <span class="red">*</span> 
                </div>
                <div class="clear">
                </div>
            </dt>
            <dt>
                <p class="purple" style="padding: 10px 0px 0px 0px;">
                    <asp:TextBox ID="txtDescription" type="text" Rows="3" Columns="15" CssClass="form-textarea"
                        runat="server" title="Write about Product/Project."></asp:TextBox>
                        
                </p>
                <div style="height: 5px;">
                </div>
                <div class="res_ad">
                    <asp:TextBox ID="txtPriceM2" CssClass="form-text wdth150_inp" title="Currency"
                        MaxLength="20" runat="server"></asp:TextBox><span class="red">*</span> 
                </div>
                <div class="clear">
                </div>
            </dt>
            <dt>
                <p class="purple" style="padding: 0px 0px 0px 0px;">
                    <strong>Picture Load</strong></p>
                <div style="height: 5px;">
                </div>
                <div class="res_ad">
                    Main
                    <br />
                    <asp:FileUpload ID="up1" CssClass="form-text wdth300" runat="server" /><span class="red">*</span> <br />
                    <br />
                    4 others
                    <br />
                    <asp:FileUpload ID="up2" CssClass="form-text wdth300" runat="server" />
                    <asp:FileUpload ID="up3" CssClass="form-text wdth300" runat="server" /><br />
                    <br />
                    <asp:FileUpload ID="up4" CssClass="form-text wdth300" runat="server" />
                    <asp:FileUpload ID="up5" CssClass="form-text wdth300" runat="server" Style="margin-left: 6px;" />
                </div>
                <div class="clear">
                </div>
            </dt>
            <dt>
                <div style="height: 15px;">
                </div>
                <label>
                    <asp:CheckBox ID="chkNewsLatter" runat="server" />
                    <span class="blue">Confirm Above Information </span>
                </label>
            </dt>
            <dt>
                <br />
                <asp:Button ID="btn_Load" CssClass="reg-blue-round-btn w75" Text="Load" 
                    runat="server" onclick="btn_Load_Click" />
            </dt>
        </dl>
    </div>
    </div>
</asp:Content>
